<%@ Page Language="C#" MasterPageFile="~/SFMaster.master" AutoEventWireup="true" CodeFile="Files.aspx.cs" Inherits="Admin_Files"  %>
<%@ Register Assembly="WebControls" Namespace="WebControls" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderMain" runat="Server">
<table width=100%><tr><td>
    <cc1:SFGrid ID="sfgFiles" runat="server" OnNeedsDataSource="sfgFiles_NeedsDataSource"
        AutoGenerateColumns="False" IsMasterPageControl="False" IsProtectedForLanguageChange="False"
        OnRowCommand="sfgFiles_RowCommand">
        <Columns>
            <asp:TemplateField>
                <itemtemplate>
                <asp:ImageButton id="ibtEdit" runat="server" CommandName="EditData" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"FileId") %>' ImageUrl="~/images/edit.gif"></asp:ImageButton>
            </itemtemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <itemtemplate>
                <asp:ImageButton id="ibtDelete" runat="server" CommandName="DeleteData" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"FileId") %>' ImageUrl="~/images/delete.gif"></asp:ImageButton>
            </itemtemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="FileDescription"></asp:BoundField>
            <asp:BoundField DataField="InsertDate" DataFormatString="{0:d}" HtmlEncode="false"></asp:BoundField>
        </Columns>
    </cc1:SFGrid>
    <cc1:SFButton ID="btnNew" runat="server" OnClick="btnNew_Click" /></td></tr></table>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderEdit" runat="Server">
    <table width="100%">
        <tr>
            <td>
                <cc1:SFLabel ID="lblFileDescription" runat="server"></cc1:SFLabel>
            </td>
            <td>
                <cc1:SFTextBox ID="txtFileDescription" runat="server" ControlsLabel="lblFileDescription"></cc1:SFTextBox>
            </td>
        </tr>
        <tr>
            <td>
                <cc1:SFLabel ID="lblInsertDate" runat="server"></cc1:SFLabel>
            </td>
            <td>
                <cc1:SFCalendar ID="calInsertDate" runat="server" ControlsLabel="lblInsertDate"></cc1:SFCalendar> 
                
               
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <cc1:SFDataList ID="lstFiles" runat="server" DataKeyField="FilesContentId" OnNeedsDataSource="lstFiles_NeedsDataSource"
                    OnItemDataBound="lstFiles_ItemDataBound">
                    <ItemTemplate>
                        <table width=100%>
                            <tr>
                                <td valign="top">
                                    <cc1:SFCheckBox AutoPostBack="true" OnCheckedChanged="Check" ID="chkLanguage" runat="server"
                                        Text='<%#DataBinder.Eval(Container.DataItem,"LanguageName") %>' />
                                </td>
                                </tr><tr>
                                <td valign="top">
                                    <asp:Panel ID="pnlFilesContents" runat="server">
                                        <table>
                                            <tr>
                                                <td valign="top">
                                                    <cc1:SFLabel ID="lblFileName" runat="server"></cc1:SFLabel>
                                                </td>
                                                <td>
                                                    <cc1:SFTextBox ID="txtFileName" runat="server" ControlsLabel="lblFileName" Text='<%#DataBinder.Eval(Container.DataItem,"FileName") %>'></cc1:SFTextBox>
                                                </td>
                                                <td rowspan=2>
                                                <asp:ImageButton ID="ibtUploadFile" runat="server" ImageUrl="~/images/upload.gif" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">
                                                    <cc1:SFLabel ID="lblFilePath" runat="server"></cc1:SFLabel>
                                                </td>
                                                <td>
                                                    <cc1:SFTextBox ID="txtFilePath" runat="server" ControlsLabel="lblFilePath" Text='<%#DataBinder.Eval(Container.DataItem,"FilePath") %>'></cc1:SFTextBox>
                                                    
                                                </td>
                                            </tr>

                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <SeparatorTemplate>
                    <hr />
                    </SeparatorTemplate>
                </cc1:SFDataList>
            </td>
        </tr>
    </table>
</asp:Content>